/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package service.sales.impl;

import dao.sales.MembersDao;
import java.util.List;
import model.sales.Members;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import service.sales.MembersService;

/**
 *
 * @author Yusup Jauhari Shandi <in.visi>
 */
@Service("membersService")
@Transactional(readOnly=true)
public class MembersServiceImpl implements MembersService{
     @Autowired private MembersDao membersDao;

    @Transactional(readOnly=false)
    @Override
    public boolean save(Members members) {
        return membersDao.save(members);
    }

    @Override
    public boolean delete(Members members) {
        return membersDao.delete(members);
    }

    @Override
    public Members getMembers(int id) {
        return membersDao.getById(id);
    }

    @Override
    public Members getMembers(String kode) {
        return membersDao.getByKode("kode", kode);
    }

    @Override
    public List<Members> getMembers() {
        return membersDao.getAll();
    }

    @Override
    public List<Members> getMembers(int start, int num) {
        return  membersDao.getAll(start, num);
    }

    @Override
    public List<Members> getAll(int start, int num, String params, String orderBy) {
        return membersDao.getAll(start, num, params, orderBy);
    }
    
}
